package pl.kosmowska.ewelina.client.app.activity.mappers;

import pl.kosmowska.ewelina.client.app.ClientFactory;
import pl.kosmowska.ewelina.client.app.activity.BankStatementImportActivity;
import pl.kosmowska.ewelina.client.app.activity.CategoryActivity;
import pl.kosmowska.ewelina.client.app.activity.ChartActivity;
import pl.kosmowska.ewelina.client.app.activity.IncomeActivity;
import pl.kosmowska.ewelina.client.app.activity.IncomeOutcomeActivity;
import pl.kosmowska.ewelina.client.app.activity.InvestmentActivity;
import pl.kosmowska.ewelina.client.app.activity.InvestmentEditActivity;
import pl.kosmowska.ewelina.client.app.activity.LoanActivity;
import pl.kosmowska.ewelina.client.app.activity.LoanEditActivity;
import pl.kosmowska.ewelina.client.app.activity.OutcomeActivity;
import pl.kosmowska.ewelina.client.app.activity.OutcomeEditActivity;
import pl.kosmowska.ewelina.client.app.activity.SavingsActivity;
import pl.kosmowska.ewelina.client.app.activity.SavingsEditActivity;
import pl.kosmowska.ewelina.client.app.activity.SignInActivity;
import pl.kosmowska.ewelina.client.app.activity.StockActivity;
import pl.kosmowska.ewelina.client.app.activity.StockEditActivity;
import pl.kosmowska.ewelina.client.app.activity.places.BankStatementImportPlace;
import pl.kosmowska.ewelina.client.app.activity.places.CategoryPlace;
import pl.kosmowska.ewelina.client.app.activity.places.ChartPlace;
import pl.kosmowska.ewelina.client.app.activity.places.IncomeOutcomePlace;
import pl.kosmowska.ewelina.client.app.activity.places.IncomePlace;
import pl.kosmowska.ewelina.client.app.activity.places.InvestmentEditPlace;
import pl.kosmowska.ewelina.client.app.activity.places.InvestmentPlace;
import pl.kosmowska.ewelina.client.app.activity.places.LoanEditPlace;
import pl.kosmowska.ewelina.client.app.activity.places.LoanPlace;
import pl.kosmowska.ewelina.client.app.activity.places.OutcomeEditPlace;
import pl.kosmowska.ewelina.client.app.activity.places.OutcomePlace;
import pl.kosmowska.ewelina.client.app.activity.places.SavingsEditPlace;
import pl.kosmowska.ewelina.client.app.activity.places.SavingsPlace;
import pl.kosmowska.ewelina.client.app.activity.places.SignInPlace;
import pl.kosmowska.ewelina.client.app.activity.places.StockEditPlace;
import pl.kosmowska.ewelina.client.app.activity.places.StockPlace;

import com.google.gwt.activity.shared.Activity;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.place.shared.Place;


public class RightActivityMapper implements ActivityMapper {

	private ClientFactory clientFactory;

	public RightActivityMapper(ClientFactory clientFactory) {
		super();
		this.clientFactory = clientFactory;
	}

	@Override
	public Activity getActivity(Place place) {
		if (place instanceof SignInPlace) {
			return new SignInActivity((SignInPlace) place, clientFactory);
		} else if (place instanceof OutcomePlace) {
			return new OutcomeActivity((OutcomePlace) place, clientFactory);
		} else if (place instanceof IncomePlace) {
			return new IncomeActivity((IncomePlace) place, clientFactory);
		} else if (place instanceof IncomeOutcomePlace) {
			return new IncomeOutcomeActivity((IncomeOutcomePlace) place, clientFactory);
		} else if (place instanceof OutcomeEditPlace) {
			return new OutcomeEditActivity((OutcomeEditPlace) place, clientFactory);
		} else if (place instanceof LoanPlace) {
			return new LoanActivity((LoanPlace) place, clientFactory);
		} else if (place instanceof LoanEditPlace) {
			return new LoanEditActivity((LoanEditPlace) place, clientFactory);
		} else if (place instanceof InvestmentPlace) {
			return new InvestmentActivity((InvestmentPlace) place, clientFactory);
		} else if (place instanceof InvestmentEditPlace) {
			return new InvestmentEditActivity((InvestmentEditPlace) place, clientFactory);
		} else if (place instanceof CategoryPlace) {
			return new CategoryActivity((CategoryPlace) place, clientFactory);
		} else if (place instanceof ChartPlace) {
			return new ChartActivity((ChartPlace) place, clientFactory);
		} else if (place instanceof SavingsPlace) {
			return new SavingsActivity((SavingsPlace) place, clientFactory);
		} else if (place instanceof SavingsEditPlace) {
			return new SavingsEditActivity((SavingsEditPlace) place, clientFactory);
		} else if (place instanceof StockPlace) {
			return new StockActivity((StockPlace) place, clientFactory);
		} else if (place instanceof StockEditPlace) {
			return new StockEditActivity((StockEditPlace) place, clientFactory);
		} else if (place instanceof BankStatementImportPlace) {
			return new BankStatementImportActivity((BankStatementImportPlace) place, clientFactory);
		} else {
			return null;
		}


	}

}
